package inherit;

// super
public class inheritSuper {
    public static void main(String[] args) {
        Student student = new Student("小明", 23, '男');
        System.out.println(student.getInfo());
    }

    static class Person {
        protected String name;
        protected int age;

        public Person(String name, int age) {
            this.name = name;
            this.age = age;
        }
    }

    static class Student extends Person {
        char gander;

        public Student(String name, int age, char gander) {
            super(name, age);
            this.gander = gander;
        }

        public String getInfo() {
            return name + " " + age + " " + gander;
        }
    }
}
